/**
 * 从键盘分别输入年、月、日，判断这一天是当年的第几天
 */

import java.util.Scanner;

public class DayOfYear {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.print("年：");
        int year = scan.nextInt();
        System.out.print("月：");
        int month = scan.nextInt();
        System.out.print("日：");
        int day = scan.nextInt();
        int sum = 0;
        switch (month) {
            case 12:
                sum += 30;
            case 11:
                sum += 31;
            case 10:
                sum += 30;
            case 9:
                sum += 31;
            case 8:
                sum += 31;
            case 7:
                sum += 30;
            case 6:
                sum += 31;
            case 5:
                sum += 30;
            case 4:
                sum += 31;
            case 3:
                if (year % 100 == 0) {
                    year /= 100;
                }
                if (year % 4 == 0) {
                    sum += 29;
                } else {
                    sum += 28;
                }
            case 2:
                sum += 31;
            case 1:
                sum += day;
                break;
            default:
                System.out.println("Illegal input!");
        }
        if (sum > 0) {
            System.out.println("Today is the " + sum + " th days of this year!");
        }
    }
}

/*
public class DayOfYear {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.print("年：");
        int year = scan.nextInt();
        System.out.print("月：");
        int month = scan.nextInt();
        System.out.print("日：");
        int day = scan.nextInt();
        if (days(year, month) < day) {
            System.out.println("Illegal day of this year!");
        } else {
            int sum = day;
            while (month > 1) {
                day = days(year, --month);
                sum += day;
            }
            System.out.println("Today is the " + sum + " th days of this year!");
        }
    }

    private static int days(int year, int month) {
        switch (month) {
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
                return 31;
            case 2:
                if (year % 100 == 0) {
                    year = year / 100;
                }
                if (year % 4 == 0) {
                    return 29;
                } else {
                    return 28;
                }
            default:
                return 30;
        }
    }
}
*/
